<?php

namespace app\admin\model\sales;

use think\Model;

/**
 * Salesorderdetailsbom
 */
class Salesorderdetailsbom extends Model
{
    // 表名
    protected $name = 'sales_salesorderdetailsbom';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function parentTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Stockmaster::class, 'parent', 'stockid');
    }

    public function componentTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Stockmaster::class, 'component', 'stockid');
    }

    public function workcentreaddedTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\manufacturing\Workcentres::class, 'workcentreadded', 'code');
    }

    public function loccodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Locations::class, 'loccode', 'loccode');
    }
}